gsk: Fix a transform leak
authorMatthias Clasen <mclasen@redhat.com>
Wed, 8 Jul 2020 20:29:32 +0000 (16:29 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 8 Jul 2020 21:44:08 +0000 (17:44 -0400)
This was found by running our testsuite under asan.

gsk/gsktransform.c

index 002a52a89b116708175d4276ce0b3d518a9dc1de..aed9eae994d5c67503d9cef83b21a895f77a5044 100644 (file)
@@ -123,7 +123,8 @@ gsk_transform_alloc (const GskTransformClass *transform_class,
 
   self->transform_class = transform_class;
   self->category = next ? MIN (category, next->category) : category;
-  self->next = gsk_transform_is_identity (next) ? NULL : next;
+  self->next = gsk_transform_is_identity (next) ? NULL : gsk_transform_ref (next);
+  g_clear_pointer (&next, gsk_transform_unref);
 
   return self;
 }